<?php
/**
 * 管理员修改密码

 * Author			peace@warmy.cn
 * Create Date		2009-03-09
 */
if($_SERVER["REQUEST_METHOD"] == "POST")
{
	Add_Op_Log("{$_SESSION["REEYEE_MANAGE"]["user"]} 修改了登录密码");
	$pwd	= md5($_POST["pwd"]);
	$sql	= "update `".USERTABLE."` set psw = '$pwd' where username='{$_SESSION["REEYEE_MANAGE"]["user"]}'";
	$db->query($sql);
	$url = ATHENA_SCRIPT_INDEX . "?Model=$ATHENA_MODEL";
	ANotify::halt("密码修改成功！",$url,$url);
}
?>
<table Class="yc" cellspacing="1" cellpadding="0" >
  <tr>
    <td width="20%" class="pwd">密　　码:</td>
    <td><input type="password" name="pwd" style="font-size:9pt;width:200px;"></td>
    </td>
  </tr>
  <tr>
    <td class="repwd">确认密码:</td>
    <td><input type="password" name="repwd"  style="font-size:9pt;width:200px;"></td>
    </td>
  </tr>
  <tr>
    <td colspan="2" class="btn">
    <input name="Submit" type="submit" class="button" value="保存" onclick="AppendCmd('save');"/>
    </td>
  </tr>
</table>
<br>
<script language="javascript">
function CheckForm()
{
	try
	{
		if(!CheckTextB(document.frmList.pwd,8,"密码不能为空！"))
				return false;
		if(!CheckTextB(document.frmList.repwd,8,"确认密码不能为空！"))
				return false;
		if(document.frmList.pwd.value != document.frmList.repwd.value)
		{
			alert('密码不一致！');
			document.frmList.pwd.focus();
			document.frmList.pwd.select();
			return false;
		}
		if(window.confirm('确信修改密码？'))
			return true;
		else
			return false;
	}
	catch(e)
	{
		//alert(e.description);
	}
	return false;
}

</script>